package edu.sctu.zcy.month201506.day20150618.ioprintwritertest;

import java.io.*;

/**
 * Created by user24 on 2015/6/18.
 */
public class Print {

    PrintWriter printWriter;
    PrintWriter printWriter1;
    public void print(String param){

       File file = new File("D:\\ZCY2\\zcy1.txt");
       File file1 = new File("D:\\ZCY2\\zcy1.txt");

        try {
            printWriter = new PrintWriter(file,param);
            printWriter.print(param);

            printWriter1 = new PrintWriter(new FileOutputStream(file1));
            printWriter1.print("zcyaghrtyhwryhtdfgbcccccccv");
//            printWriter1.write("zdasdfojgiowghsrtb");

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        printWriter.flush();
        printWriter.close();

        printWriter1.close();

    }
}
